package esya;

import java.util.Calendar;
import java.text.SimpleDateFormat;


public class compDate {
	
	public String getDate(){
		
		  Calendar currentDate = Calendar.getInstance();
		  SimpleDateFormat formatter= 
		  new SimpleDateFormat("dd/MMM/ HH:mm:ss");
		  String dateNow = formatter.format(currentDate.getTime());
		  //System.out.println("Now the date is :=>  " + dateNow);
		  
		  return dateNow;
	}
	
	public String comp(){						//converts date to string of type ddMMMyy for now.
		
		compDate doe=new compDate();
		String dat=doe.getDate();
		
		String s[]= dat.split(" ");
		String r=s[0];
		
		s=r.split("/");
		
		String n="";
		for (int i=0;i<2;i++){
			n=n+s[i];
		
		}
		//System.out.println(n);
		
	return n;
		
	}

}
